﻿#pragma once

#include "ElementTreeCtrl.h"

// CElementTreeView 视图

class CElementTreeView : public CTreeView
{
	DECLARE_DYNCREATE(CElementTreeView)

protected:
	CElementTreeView();           // 动态创建所使用的受保护的构造函数
	virtual ~CElementTreeView();

public:
#ifdef _DEBUG
	virtual void AssertValid() const;
#ifndef _WIN32_WCE
	virtual void Dump(CDumpContext& dc) const;
#endif
#endif

protected:
	//CImageList	m_il;
	CElementTreeCtrl m_wndTreeCtrl;
	BOOL m_bSubclassed;

public:
	void	Populate();

public:
	CTreeCtrl& GetTreeCtrl() const;

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnNMClick(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMDblclk(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMRClick(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnTvnItemExpanding(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnTvnItemExpanded(NMHDR *pNMHDR, LRESULT *pResult);

	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
};


